package great.project.test.controller;

import great.project.common.http.Result;
import great.project.test.servce.AuthService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <div  style="border:2px solid none;margin:20px;padding:15px;font-size:24px;text-align:center;color:aqua;">
 * <p>
 *      模拟 登录和注册接口
 *
 *  </div>
 *
 * @author zhangshun
 * @date 2021/1/29 14:35
 */
@RestController
@RequestMapping(value = "auth")
public class AuthController {
        @Resource
        private AuthService authService;

        /**
         * 登录接口
         *
         * @param username 用户名字
         * @param password 密码
         * @return 结果
         */
        @RequestMapping(value = "login", method = RequestMethod.GET)
        public Result<String> login(
                @RequestParam(value = "username") String username,
                @RequestParam(value = "password") String password
        ) {
                return authService.login(username, password);
        }


}
